package com.meilele.dao.czh;

import com.meilele.entity.czh.Application;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ApplicationMapper {
    @Delete({
        "delete from application",
        "where application_id = #{applicationId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer applicationId);

    @Insert({
        "insert into application (application_id, application_name, ",
        "application_tel, appliciton_city)",
        "values (#{applicationId,jdbcType=INTEGER}, #{applicationName,jdbcType=VARCHAR}, ",
        "#{applicationTel,jdbcType=VARCHAR}, #{applicitonCity,jdbcType=VARCHAR}),#{applicitonTime,jdbcType=DATE})"
    })
    int insert(Application record);

    int insertSelective(Application record);

    @Select({
        "select",
        "application_id, application_name, application_tel, appliciton_city,application_time",
        "from application",
        "where application_id = #{applicationId,jdbcType=INTEGER}"
    })
    @ResultMap("com.meilele.dao.czh.ApplicationMapper.BaseResultMap")
    Application selectByPrimaryKey(Integer applicationId);


    @Select({
            "select",
            "application_id, application_name, application_tel, appliciton_city,application_time",
            "from application"
    })
    @ResultMap("com.meilele.dao.czh.ApplicationMapper.BaseResultMap")
    List<Application> selectByPrimaryAll();

    int updateByPrimaryKeySelective(Application record);

    @Update({
        "update application",
        "set application_name = #{applicationName,jdbcType=VARCHAR},",
          "application_tel = #{applicationTel,jdbcType=VARCHAR},",
          "appliciton_city = #{applicitonCity,jdbcType=VARCHAR}",
        "where application_id = #{applicationId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Application record);
}